package com.sumer.test.ioc.bean;

import com.sumer.beans.factory.DisposableBean;
import com.sumer.beans.factory.InitializingBean;
import com.sumer.beans.factory.annotation.Value;
import com.sumer.stereotype.Component;

@Component
public class Car implements InitializingBean, DisposableBean {

    @Value("${brand}")
    private String brand;

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("destroy 方法");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("init 方法");
    }

    @Override
    public String toString() {
        return "Car{" +
                "brand='" + brand + '\'' +
                '}';
    }
}
